<include file="public@header" />
</head>
<body>
<div class="wrap js-check-wrap">
	<ul class="nav nav-tabs">
		<li class="active"><a href="{:url('index')}">机构件列表</a></li>
	</ul>
	<form class="well form-inline margin-top-20" method="get" action="">
		关键字:
		<input type="text" class="form-control" name="keyword" style="width: 200px;"
			   value="{:input('request.keyword/s')}" placeholder="请输入关键字...">
		公关状态：
		<select class="form-control" style="width: 200px;" name="relations">
			<option value="0">未选择</option>
			<option value="1" <eq name=":input('request.relations')" value="1">selected</eq> >未公关</option>
			<option value="2" <eq name=":input('request.relations')" value="2">selected</eq> >已公关</option>
		</select>
		机构类型：
		<select class="form-control" style="width: 200px;" name="type">
			<option value="0">未选择</option>
			<volist name="types" id="vo">
				<option value="{$vo.id}" <eq name=":input('request.type')" value="$vo.id">selected</eq> >{$vo.name}</option>
			</volist>
		</select>
		<input type="submit" class="btn btn-primary" value="搜索"/>
		<a class="btn btn-danger" href="{:url('index')}">清空</a>
	</form>
	<div class="table-actions">
		<div class="btn-group">
			<if condition="auth_check('add')"><a href="{:url('add')}" class="btn btn-default">新增</a></if>
		</div>
	</div>
	<table class="table table-hover table-bordered margin-top-20">
		<thead>
		<tr>
			 <th width="50">ID</th>
			<th>名称</th>
			<th>省份</th>
			<th>城市</th>
			<th>详细地址</th>
			<th>是否公关</th>
			<th>机构类型</th>
			<th>备注</th>
			<th>录入人</th>
			<th>创建时间</th>
			<th>操作</th>
		</tr>
		</thead>
		<tbody>
		<foreach name="lists" item="vo">
			<tr>
				<td>{$vo.id}</td>
				<td>{$vo.name}</td>
				<td>{$vo.aname}</td>
				<td>{$vo.cname}</td>
				<td>{$vo.address}</td>
				<td>
					<switch name="vo.relations">
						<case value="0">未公关</case>
						<case value="1">已公关</case>
					</switch>
				</td>
				<td>
					{$vo.tname}
				</td>
				<td>{$vo.remark}</td>
				<td>{$vo.user_nickname}</td>
				<td>{$vo.create_time|date="Y-m-d",###}</td>
				<td>
					<a href="{:cmf_url('edit',['id' => $vo['id']])}">编辑</a>
					<if condition="auth_check('user_lists')"><a href='javascript:parent.openIframeLayer("{:url("user_lists",["aid" => $vo["id"]])}","联系人列表")'>联系人列表</a></if>
				</td>
			</tr>
		</foreach>
		</tbody>
	</table>
	<div class="pagination">{$page}<li><a>共计 {$lists->total()} 条</a></li></div>
</div>
<script src="__STATIC__/js/admin.js"></script>
</body>
</html>